home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / tpmirrorl-r.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  4KB  |  138 lines

  1. /* TPMirrorL-R.rexx V2.0 -- Mirror A Flyer Clip    */
  2. /* By Bob Caron © 1995 NewTek Inc.                 */
  3.  
  4. parse arg InClipName","OutClipName","StartField","EndField
  5.  
  6. Address "DigiPaint"
  7. options results
  8.  
  9.  
  10. screen=0
  11. if inclipname="" & outclipname="" then screen=1
  12. if screen=1 then do
  13.    startfield=1
  14.    endfield=1
  15.    outclipname="Test"
  16.    end
  17.  
  18. IFFBaseName=OutClipName
  19.  
  20. if ~show('l','rexxsupport.library') then do
  21.   if ~addlib('rexxsupport.library',0,-30,34) then do
  22.     exit
  23.   end
  24. end
  25.  
  26. /* Reset Paint */
  27. 'Pmcl'
  28. 'Pot0' 0
  29. 'Pot1' 0
  30. 'Poth' $8000
  31. 'Potv' $8000
  32. 'Spoh' $8000
  33. 'Spov'
  34. /* End Of Reset*/
  35.  
  36. PageWide=752
  37. PageHigh=480
  38. dots=0
  39. XWin = 100
  40. YWin = 40
  41. Clear = d2c(12)
  42. nv = ''
  43. cr = '0a'x
  44. call getfontsize
  45.  
  46. wid = width*48
  47. hei = theight+height*10
  48.  
  49. if screen=0 then do
  50.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/TPMirrorL-R Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  51.        exit
  52.    end
  53. end
  54.  
  55. do Frame = StartField to (StartField+(EndField-StartField)/2)
  56.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  57.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  58.   call filter()                    /* Do The filter Thing...                 */
  59.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  60.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  61.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  62.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  63.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  64.   end
  65. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  66. exit
  67.  
  68. filter:  /* Do a filter */
  69.  
  70.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  71.   'Pmcl'                           /* Set to normal paint mode */
  72.   'Maxc'        /* Set center transparency off */
  73.   'Maxe'        /* Set edge transparency off */
  74.   Call CutBrush(0,0,376,480)       /*  Cut brush along top */
  75.   'Flix'                           /* Flip about x axis (reverse y) */
  76.   'Pend' 564 240                   /* Place brush */
  77.   'Penu' 564 240
  78.   'Brt7'
  79.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  80.  
  81. return
  82.  
  83.  
  84. OpenWindow:
  85. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  86.   pdots="...."
  87.   dots=dots+1
  88.   if dots>4 then dots=1
  89.   call writech('Window',Clear||nv||cr)
  90.   call writech('Window','Current Source Clip ['InClipName']'cr)
  91.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  92.   call writech('Window',''cr)
  93.   call writech('Window','Current Frame: 'Frame/2''cr)
  94.   call writech('Window','    End Frame:'EndFrame/2''cr)
  95.   call writech('Window',''cr)
  96.   call writech('Window','Processing'right(pdots,dots)||cr)
  97.  
  98. return
  99.  
  100.  
  101. getfontsize:
  102.  
  103. if open('font','env:sys/font.prefs','R') then do
  104.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  105.    call close('font')
  106.    font = substr(font,index(font,'FONT')+4)
  107.    font = substr(font,index(font,'FONT')+4)
  108.    height = c2d(substr(font,29,2))
  109.    tfont = substr(font,index(font,'FONT')+4)
  110.    theight = c2d(substr(tfont,29,2))
  111.    font = substr(font,33)
  112.    font = left(font,index(font,d2c(0))-1-5)
  113.    if open('font','FONTS:'font'/'height,'R') then do
  114.       width = c2d(right(readch('font',116),2))
  115.       call close('font')
  116.   end
  117.   else if height=9 then width = 10
  118.                    else width = 8
  119. end
  120.   else do
  121.   theight = 8
  122.   height = 8
  123.   width = 8
  124. end
  125.  
  126. return
  127.  
  128.  
  129. CutBrush: PROCEDURE  /* Cut out a brush with corners at (x1,y1) and (x2,y2) */
  130.   arg x1, y1, x2, y2
  131.   'Dotb'        /* smallest brush size */
  132.   'Drre'        /* Rectangle mode  */
  133.   'Scis'        /* Scissors on, for cutting a brush  */
  134.   'Pend' x1 y1  /* Get in top Left corner  */
  135.   'Penu' x2 y2  /* lift pen to get brush!  */
  136. return 0
  137.  
  138.